from django.contrib import admin

from system.models import Block, AccessToken


# Register your models here.
@admin.register(Block)
class BlockAdmin(admin.ModelAdmin):
    list_display = ['pk', 'account', 'address', 'remark', 'create_time']

    fieldsets = [
        (
            None,
            {
                "fields": [
                    "account", 
                    "address", 
                ],
            },
        ),
        (
            "额外选项",
            {
                "classes": ["collapse"],
                "fields": ["remark", "enable"],
            },
        ),
    ]


@admin.register(AccessToken)
class AccessTokenAdmin(admin.ModelAdmin):
    list_display = ['pk', 'appid', 'token', 'update_time', 'create_time']

    fieldsets = [
        (
            None,
            {
                "fields": [
                    "appid", 
                    "token", 
                ],
            },
        ),
        (
            "额外选项",
            {
                "classes": ["collapse"],
                "fields": ["remark", "enable"],
            },
        ),
    ]
